if(!jsx3.lang.Class.forName("tibco.admin.enterpriseAssets.envDef.EnvDef")) {
    jsx3.require("com.gix.gui.Block")

    /**
     * envDef
     */
    jsx3.lang.Class.defineClass("tibco.admin.enterpriseAssets.envDef.EnvDef",
            com.gix.gui.Block,
            null,
            function (envdef) {

                /**
                 * instance initializer
                 * @param strName {String} unique name distinguishing this object from all other JSX GUI objects in the JSX application
                 * @param vntLeft {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
                 * @param vntTop {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
                 * @param vntWidth {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
                 * @param vntHeight {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
                 * @param strHTML {String} Text/HTML markup to place in the jsx3.gui.Block instance
                 */
                envdef.prototype.init = function(strName, vntLeft, vntTop, vntWidth, vntHeight, strHTML) {
                    //call constructor for super class (the super expects the name of the object and the function that it is an instance of)
                    this.jsxsuper(strName, vntLeft, vntTop, vntWidth, vntHeight, strHTML);
                };

                envdef.prototype.loadSubComponent = function(domeNode, path, target, fctn) {
                    if(domeNode == "BODYBLOCK") {
                        domeNode = this.getServer().getBodyBlock()
                    }
                    else {
                        domeNode = this.getDescendantOfName(domeNode, false, false)
                        if(domeNode.getChildren().length > 0) {
                            return
                        }
                    }
                    if(target && fctn) {
                        tibco.admin.Main.loadUIResourceAsync(domeNode, "tibco.admin", path, target, fctn, true)
                    }
                    else {
                        tibco.admin.Main.loadUIResourceAsync(domeNode, "tibco.admin", path, null, null, true)
                    }
                }

                envdef.prototype.subscribeAll = function() {
                    var me = this;
                    tibco.admin.PubSub.subscribe(tibco.admin.enterpriseAssets.envDef.EventID.ENVIRONMENT_ROW_SELECTED, me, me.loadDetails);
                    tibco.admin.PubSub.subscribe(tibco.admin.enterpriseAssets.envDef.EventID.ENVIRONMENT_REQUIRE_NEW, me, me.loadGenInfoAdd);
                    tibco.admin.PubSub.subscribe(tibco.admin.enterpriseAssets.envDef.EventID.ENVIRONMENT_ADD_CANCELED, me, me.resetDetailPanes);
                    tibco.admin.PubSub.subscribe(tibco.admin.enterpriseAssets.envDef.EventID.ENVIRONMENT_REMOVE_SUCCESSEFUL, me, me.resetDetailPanes);
                }

                envdef.prototype.unsubscribeAll = function() {
                    var me = this;
                    tibco.admin.PubSub.unsubscribe(tibco.admin.enterpriseAssets.envDef.EventID.ENVIRONMENT_ROW_SELECTED, me);
                    tibco.admin.PubSub.unsubscribe(tibco.admin.enterpriseAssets.envDef.EventID.ENVIRONMENT_REQUIRE_NEW, me);
                    tibco.admin.PubSub.unsubscribe(tibco.admin.enterpriseAssets.envDef.EventID.ENVIRONMENT_ADD_CANCELED, me);
                    tibco.admin.PubSub.unsubscribe(tibco.admin.enterpriseAssets.envDef.EventID.ENVIRONMENT_REMOVE_SUCCESSEFUL, me);
                }

                envdef.prototype.loadDetails = function(objEvent) {
                    try {
                        if(objEvent.isRetained) {
                            return;
                        }
                        if(objEvent.environmentID) {
                            var paneDetails27 = this.getDescendantOfName("paneDetails27", false, false)
                            paneDetails27.setDisplay(jsx3.gui.Block.DISPLAYBLOCK, false);
                            this.getDescendantOfName("paneWelcomeMessage_27").setDisplay(jsx3.gui.Block.DISPLAYNONE, false).getParent().repaint();
                            var me = this;
                            this.loadSubComponent("paneDetails27", "tibco/admin/enterpriseAssets/envDef/envDtls/components/envDtls.xml", me, me.envDtlsLoaded);
                        }
                        else {
                            this.resetDetailPanes();
                        }
                    }
                    catch(e) {
                        tibco.admin.util.Log.ENVIRONMENT.error("Error in tibco.admin.enterpriseAssets.envDef.EnvDef#loadDetails: " + e)
                    }
                }

                envdef.prototype.loadGenInfoAdd = function(objEvent) {
                    try {
                        if(objEvent.isRetained) {
                            return;
                        }
                        this.loadSubComponent("BODYBLOCK", "tibco/admin/enterpriseAssets/envDef/envDtls/genInfo/ui/genInfoAddDialog.xml");

                    }
                    catch(e) {
                        tibco.admin.util.Log.ENVIRONMENT.error("Error in tibco.admin.enterpriseAssets.envDef.EnvDef#loadGenInfoAdd: " + e)
                    }
                }

                envdef.prototype.resetDetailPanes = function(objEvent) {
                    var paneDetails27 = this.getDescendantOfName("paneDetails27", false, false)
                    paneDetails27.setDisplay(jsx3.gui.Block.DISPLAYNONE, false);
                    this.getDescendantOfName("paneWelcomeMessage_27").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, false).getParent().repaint();
                }

                envdef.prototype.isLoaded = function(msg) {
                    if(msg.status == "SUCCESS") {
                        this.envList = msg.obj;
                        this.envList.repaint()
                    }
                }

                envdef.prototype.envDtlsLoaded = function(msg) {
                    if(msg.status == "SUCCESS") {
                        this.envDtls = msg.obj;
                        var me = this;
                        this.envDtls.handler = me;
                        this.envDtls.repaint()
                    }
                }

                envdef.prototype.refresh = function() {
                    if(this.envList) {
                        this.envList.publishRefresh();
                    }
                    if(this.envDtls) {
                        this.envDtls.refresh();
                    }
                }

                envdef.prototype.isInEditMode = function() {
                    if(!this.envDtls) {
                        return false;
                    }
                    return this.envDtls.isInEditMode();
                }

                envdef.prototype.beginEditMode = function(objPlugin) {
                    this.handler.beginEditMode();
                    if(this.envList) {
                        this.envList.beginEditMode();
                    }
                }

                envdef.prototype.endEditMode = function(objPlugin) {
                    this.handler.endEditMode();
                    if(this.envList) {
                        this.envList.endEditMode();
                    }
                }

                envdef.prototype.allowComponentUnload = function(target, fctnYes, fctnNo, args) {
                    if(this.envDtls) {
                        this.envDtls.allowComponentUnload(target, fctnYes, fctnNo, args);
                    }
                    else {
                        fctnYes.call(target, args);
                    }
                };

                envdef.prototype.unload = function() {
                    if(this.envDtls) {
                        this.envDtls.unload();
                    }
                }
            });
}